package by.semerikov.tests;
 

import java.sql.SQLException;
import java.util.List;

import org.junit.Test;

import by.semerikov.dao.UserSession;
import by.semerikov.dao.factory.mysqlJdbc.UserSessionDAO;
import by.semerikov.data.Connector;
import by.semerikov.exceptions.BadObjectException;

public class UserSessionDAOTest {

	@Test
	public void test() {
		try {
			UserSessionDAO us = new UserSessionDAO(Connector.getConnection());
			UserSession test = new UserSession(null, 1, "123");
			us.create(test);
			test = new UserSession(null, null, "123");
			List<UserSession> d =  us.read(test);
			d.size();
			us.delete(test);
		} catch (SQLException e)  {
			e.printStackTrace();
		}
		catch (BadObjectException e) {
			e.printStackTrace();
		}
	}

}
